import 'package:flutter/material.dart';
import 'package:flutter_eve_plugin/components/main/app_bar.dart';
import 'package:flutter_eve_plugin/store/main.dart';
import 'package:flutter_eve_plugin/store_vm/app_vm.dart';
import 'package:flutter_redux/flutter_redux.dart';

//import 'package:redux/redux.dart';
//import 'package:webview_flutter/webview_flutter.dart';

class WebViewContainer extends StatefulWidget {
  final String url;
  final String title;

  WebViewContainer(this.url, {this.title});

  @override
  _WebViewContainerState createState() => _WebViewContainerState();
}

class _WebViewContainerState extends State<WebViewContainer> {
  // final _key = UniqueKey();

  @override
  Widget build(BuildContext context) {
    return StoreConnector<AppState, AppStateViewModel>(
        converter: (store) => AppStateViewModel(state: store.state),
        builder: (context, vm) {
          return Scaffold(
              appBar: buildAppBar(context, title: widget.title),
              body: Column(
                children: [
//              Expanded(
//                  child: WebView(
//                      key: _key,
//                      javascriptMode: JavascriptMode.unrestricted,
//                      initialUrl: widget.url
//                  )
//              )
                ],
              ));
        });
  }
}
